package train48days;

import java.util.Scanner;

public class 小易的升级之路 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int n = sc.nextInt();
            int c= sc.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = sc.nextInt();
                if (arr[i]<=c){
                    c+=arr[i];
                } else if (arr[i]>c) {
                    c+=getyue(c,arr[i]);
                }
            }
            System.out.println(c);
        }
    }
    public static int getyue(int a,int b){
        int yue = 0;
        for (int i = 2; i<=a; i++) {
            if (a%i==0&b%i==0){
                yue =i;
            }
        }
        return yue;
    }
}
